<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {$LOAD_STYLE.top|raw}
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
        
			<input type="hidden" name="pid" value="{$model.pid??''}" placeholder="请输入隶属面料ID" class="layui-input"  verify="must">

			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">产品编号</label>
				<div class="layui-input-block">
				  <input type="text" name="number" value="{$model.number??''}" placeholder="请输入隶属产品编号" class="layui-input"  verify="must">
				</div>
			</div>
			
			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">进货产品编号</label>
				<div class="layui-input-block">
				  <input type="text" name="onumber" value="{$model.onumber??''}" placeholder="请输入进货产品编号" class="layui-input"  verify="must">
				</div>
			</div>
			
			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">色号</label>
				<div class="layui-input-block">
				  <input type="text" name="colorid" value="{$model.colorid??''}" placeholder="请输入色号" class="layui-input"  verify="must">
				</div>
			</div>
			
			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">进货产品色号</label>
				<div class="layui-input-block">
				  <input type="text" name="ocolorid" value="{$model.ocolorid??''}" placeholder="请输入进货产品色号" class="layui-input"  verify="must">
				</div>
			</div>
			
			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">加价金额</label>
				<div class="layui-input-block">
				  <div class="input-group layui-col-md12">
				  <input type="text" name="rose" value="{$model.rose??0}" placeholder="请输入加价金额" class="layui-input"  verify="must">
				  <span class="input-group-addon">元</span>
				  </div>
				</div>
			</div>
			
			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">进货加价金额</label>
				<div class="layui-input-block">
				  <div class="input-group layui-col-md12">
				  <input type="text" name="rose2" value="{$model.rose2??0}" placeholder="请输入进货加价金额" class="layui-input"  verify="must">
				  <span class="input-group-addon">元</span>
				  </div>
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">颜色类型</label>
				<div class="layui-input-block">
					{php}if(!$action_up) $model["gray"]=0;{/php}
					{volist name="options.gray_radio" id="v"}
					{if $v.id == $model.gray}
					<input type="radio" name="gray" title="{$v.val}" value="{$v.id}" checked>
					{else/}
					<input type="radio" name="gray" title="{$v.val}" value="{$v.id}">
					{/if}
					{/volist}
				</div>
			</div>

			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">颜色名称</label>
				<div class="layui-input-block">
				  <input type="text" name="name" value="{$model.name??''}" placeholder="请输入颜色名称" class="layui-input"  verify="must">
				</div>
			</div>

			<div class="layui-form-item2 layui-col-md6">
				<label class="layui-form-label">HEX颜色值</label>
				<div class="layui-input-block">
				  <div class="input-group layui-col-md12">
				  <span class="input-group-addon" hex>#</span>
				  <input type="text" name="val" value="{$model.val??''}" placeholder="请输入HEX颜色值" class="layui-input">
				  </div>
				</div>
			</div>

			<div class="layui-form-item layui-img-upload">
				<label class="layui-form-label">花灰色图片</label>
				<div class="layui-input-block">
					{:opt_photo("image")}
					<button class="pear-btn pear-btn-primary pear-btn-sm upload-image" type="button">
						<i class="icon pear-icon pear-icon-picture">
						</i>
						上传图片
					</button>
					<input name="image" type="hidden" class="layui-input" value="{$model.image??''}">
					<div class="upload-image">
						<span>
						</span>
						<img class="upload-image" src="{$model.image??''}">
					</div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">排序</label>
				<div class="layui-input-block">
				  <input type="text" name="sort" value="{$model.sort??'2000'}" placeholder="请输入排序" class="layui-input"  verify="must">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">是否显示</label>
				<div class="layui-input-block">
					<input type="checkbox" lay-skin="switch" value="is_show" lay-text="启用|禁用" {if $model.is_show??1 == 1} checked {/if}>
				</div>
			</div>

        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="save" verify="submit">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script>
	layui.use(['form', 'jquery', 'uploads','common','mycomm'], function () {
		let form = layui.form;
		let $ = layui.jquery;
		let common = layui.common;
		let mycomm = layui.mycomm;

		$('[name="val"]').change(function(){
			$('[hex]').css("background",'#'+$(this).val());
		});
		
		mycomm.editSubmit('',function(){
			{if ($action_up)}
			parent.location.reload();
			{/if}
		});
	})
</script>
{$LOAD_STYLE.bottom|raw}

</body>
</html>